import axios from "axios";

export function saveOrUpdateWebMenu(data: any) {
    return axios.post("/sys/web/menu/saveOrUpdate", data);
}

export function deleteWebMenuByCode(params: any) {
    return axios.delete("/sys/web/menu/delete/code", {
        params: params
    });
}

export function exportWebMenuFile(data: any) {
    return axios.post("/sys/web/menu/export", data, {
        responseType: 'blob'
    });
}

export function importWebMenuFile(data: any) {
    return axios.post("/sys/web/menu/import", data, {
        headers: {'content-type': 'application/x-www-form-urlencoded'},
    });
}

/**
 * 获取当前登陆用户菜单
 */
export function getCurrUserMenu() {
    return axios.get("/sys/web/menu/routes")
}


export function getWebMenuListPage(params: any) {
    return axios.get("/sys/web/menu/list/page", {
        params: params
    });
}

export function getWebMenuListAll() {
    return axios.get("/sys/web/menu/list/all");
}


export function getWebMenuShowListAll(params: any) {
    return axios.get("/sys/web/menu/show/list/all", {
        params: params
    });
}


export function updateRoleMenu(data: any) {
    return axios.post("/sys/web/menu/show/updateRoleMenu", data);
}
